import { request } from '@@/plugin-request';
import randomstring from 'randomstring';

const uuid = () => {
  return randomstring.generate(7);
};

export const exec = (code) => {
  return request('/exec', {
    method: 'POST',
    data: {
      id: uuid(),
      code,
    },
  });
};
